package kafka2Hbase.bean

class MyResult01(var name: String, var age: Int) extends Serializable {

}

object MyResult01 {
  //注入方法
  def apply(name: String, age: Int): MyResult01 =
    new MyResult01(name, age)

  //提取方法：提取固定数量的参数
  def unapply(applyDemo: MyResult01): Option[(String, Int)] = {
    if (applyDemo == null) {
      None
    } else {
      Some(applyDemo.name, applyDemo.age)
    }
  }
}